<!DOCTYPE html>

<!--[if IE 8]>
<html lang="en" class="ie8"> <![endif]-->

<!--[if IE 9]>
<html lang="en" class="ie9"> <![endif]-->

<!--[if !IE]><!-->
<html lang="en"> <!--<![endif]-->

<!-- BEGIN HEAD -->

<head>
    <base href="/hxhmanage/"/>
    <meta charset="utf-8"/>

    <title>好洗欢管理平台</title>

    <meta content="width=device-width, initial-scale=1.0" name="viewport"/>

    <meta content="" name="description"/>

    <meta content="" name="author"/>

    <!-- BEGIN GLOBAL MANDATORY STYLES -->

    <link href="css/vendor/bootstrap.min.css" rel="stylesheet" type="text/css"/>

    <link href="css/vendor/bootstrap-responsive.min.css" rel="stylesheet" type="text/css"/>

    <link href="css/vendor/font-awesome.min.css" rel="stylesheet" type="text/css"/>

    <link href="css/vendor/style-metro.css" rel="stylesheet" type="text/css"/>

    <link href="css/vendor/style.css" rel="stylesheet" type="text/css"/>

    <link href="css/vendor/style-responsive.css" rel="stylesheet" type="text/css"/>

    <link href="css/vendor/default.css" rel="stylesheet" type="text/css" id="style_color"/>

    <link href="css/vendor/uniform.default.css" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" type="text/css" href="css/vendor/multi-select-metro.css">

    <!-- END GLOBAL MANDATORY STYLES -->

    <!-- BEGIN PAGE LEVEL STYLES -->

    <link rel="stylesheet" type="text/css" href="css/vendor/select2_metro.css"/>

    <link rel="stylesheet" href="css/vendor/DT_bootstrap.css"/>

    <!-- END PAGE LEVEL STYLES -->

    <link rel="shortcut icon" href="images/logo.png"/>

</head>
<body class="page-header-fixed page-sidebar-closed">
<!-- BEGIN HEADER -->

<div id="addComm" class="modal hide fade" tabindex="-1" data-width="960">

    <div class="portlet box green">


        <div class="portlet-body form">

            <!-- BEGIN FORM-->


            <label class="control-label">选择关联小区</label>

            <div class="controls">



                    <select multiple="multiple" id="my_multi_select1" name="my_multi_select1[]">

                        <!--<option>Dallas Cowboys</option>-->



                    </select>



            </div>

            <div class="controls">

                <button id="js_rel_commbtn" class="btn red ">

                    保存 <i class="icon-ok-sign"></i>

                </button>

                <button id="js_rel_cancelbtn" class="btn yellow ">

                    取消 <i class="icon-ok-sign"></i>

                </button>
                </div>


            <!-- END FORM-->

        </div>

    </div>

</div>

<div class="header navbar navbar-inverse navbar-fixed-top">

    <!-- BEGIN TOP NAVIGATION BAR -->

    <div class="navbar-inner">

        <div class="container-fluid">

            <!-- BEGIN LOGO -->

            <a class="brand" href="index.html" style="padding:0px;">

                <img src="images/logo.png" alt="logo"/>

            </a>

            <!-- END LOGO -->

            <!-- BEGIN RESPONSIVE MENU TOGGLER -->

            <a href="javascript:;" class="btn-navbar collapsed" data-toggle="collapse" data-target=".nav-collapse">

                <img src="images/menu-toggler.png" alt=""/>

            </a>

            <!-- END RESPONSIVE MENU TOGGLER -->

            <!-- BEGIN TOP NAVIGATION MENU -->


            <!-- END TOP NAVIGATION MENU -->

        </div>

    </div>

    <!-- END TOP NAVIGATION BAR -->

</div>
<!-- BEGIN CONTAINER -->


<div class="page-container row-fluid">

    <!-- BEGIN SIDEBAR -->

    <div class="page-sidebar nav-collapse collapse">

        <!-- BEGIN SIDEBAR MENU -->

        <ul class="page-sidebar-menu">

            <li>

                <!-- BEGIN SIDEBAR TOGGLER BUTTON -->

                <div class="sidebar-toggler hidden-phone"></div>

                <!-- BEGIN SIDEBAR TOGGLER BUTTON -->

            </li>


            <li>

                <a href="indexAction!setStrutsPage.action?pageFlag=order/ordermana.html">

                    <i class="icon-file-text"></i>

                    <span class="title">订单管理</span>

                </a>

            </li>
            <li>

                <a href="indexAction!setStrutsPage.action?pageFlag=community/communityList.html">

                    <i class="icon-home"></i>

                    <span class="title">地址管理</span>

                </a>

            </li>

            <li class="active ">

                <a href="indexAction!setStrutsPage.action?pageFlag=diser/disermana.html">

                    <i class="icon-user-md"></i>

                    <span class="title">配送人员管理</span>

                </a>

            </li>

            <li>

                <a href="indexAction!setStrutsPage.action?pageFlag=pro/product.html">

                    <i class="icon-barcode"></i>

                    <span class="title">产品管理</span>

                </a>

            </li>


        </ul>

        <!-- END SIDEBAR MENU -->

    </div>

    <!-- END SIDEBAR -->

    <!-- BEGIN PAGE -->

    <div class="page-content">

        <!-- BEGIN SAMPLE PORTLET CONFIGURATION MODAL FORM-->

        <div id="portlet-config" class="modal hide">

            <div class="modal-header">

                <button data-dismiss="modal" class="close" type="button"></button>

                <h3>portlet Settings</h3>

            </div>

            <div class="modal-body">

                <p>Here will be a configuration form</p>

            </div>

        </div>

        <!-- END SAMPLE PORTLET CONFIGURATION MODAL FORM-->

        <!-- BEGIN PAGE CONTAINER-->

        <div class="container-fluid">

            <!-- BEGIN PAGE HEADER-->

            <div class="row-fluid">

                <div class="span12">


                </div>

            </div>

            <!-- END PAGE HEADER-->

            <!-- BEGIN PAGE CONTENT-->

            <div class="row-fluid">

                <div class="span12">

                    <!-- BEGIN EXAMPLE TABLE PORTLET-->

                    <div class="portlet box light-grey">

                        <div class="portlet-title">

                            <div class="caption"><i class="icon-globe"></i>配送人员-小区管理</div>

                            <div class="tools">

                                <a href="javascript:;" class="collapse"></a>

                                <!--<a href="#portlet-config" data-toggle="modal" class="config"></a>-->

                                <!--<a href="javascript:;" class="reload"></a>-->

                                <!--<a href="javascript:;" class="remove"></a>-->

                            </div>

                        </div>

                        <div class="portlet-body">

                            <div class="btn-group" style="font-size: 15px;">

                                <a class="btn blue" data-toggle="modal" id="queryCommBtn">关联<i
                                        class="icon-plus"></i></a>

                            </div>

                            <table class="table table-striped table-bordered table-hover" id="sample_editable_1">

                                <thead>

                                <tr>

                                    <th style="width:8px;"><input type="checkbox" class="group-checkable"
                                                                  data-set="#sample_editable_1 div span .checkboxes"/>
                                    </th>

                                    <th class="hidden-480">城市</th>

                                    <th class="hidden-480">小区</th>

                                    <th class="hidden-480">操作</th>
                                    <!--              <th class="hidden-480">Edit</th>
                                                  <th class="hidden-480">Delete</th>
              -->
                                    <!--<th ></th>-->

                                </tr>

                                </thead>

                            </table>

                        </div>

                    </div>

                    <!-- END EXAMPLE TABLE PORTLET-->

                </div>

            </div>


            <!-- END PAGE CONTENT-->

        </div>

        <!-- END PAGE CONTAINER-->

    </div>

    <!-- END PAGE -->

</div>

<!-- BEGIN FOOTER -->

<div class="footer">

    <div class="footer-inner">


    </div>

    <div class="footer-tools">

			<span class="go-top">

			<i class="icon-angle-up"></i>

			</span>

    </div>

</div>


<!-- END FOOTER -->

<!-- END CONTAINER -->


<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->

<!-- BEGIN CORE PLUGINS -->

<script src="js/vendor/jquery-1.10.1.min.js" type="text/javascript"></script>

<script src="js/vendor/jquery-migrate-1.2.1.min.js" type="text/javascript"></script>

<!-- IMPORTANT! Load jquery-ui-1.10.1.custom.min.js before bootstrap.min.js to fix bootstrap tooltip conflict with jquery ui tooltip -->

<script src="js/vendor/jquery-ui-1.10.1.custom.min.js" type="text/javascript"></script>

<script src="js/vendor/bootstrap.min.js" type="text/javascript"></script>

<script src="js/vendor/ajaxfileupload.js" type="text/javascript"></script>
<!--[if lt IE 9]>

<script src="js/vendor/excanvas.min.js"></script>

<script src="js/vendor/respond.min.js"></script>

<![endif]-->

<script src="js/vendor/jquery.slimscroll.min.js" type="text/javascript"></script>

<script src="js/vendor/jquery.blockui.min.js" type="text/javascript"></script>

<script src="js/vendor/jquery.cookie.min.js" type="text/javascript"></script>

<script src="js/vendor/jquery.uniform.min.js" type="text/javascript"></script>

<!-- END CORE PLUGINS -->

<!-- BEGIN PAGE LEVEL PLUGINS -->

<script type="text/javascript" src="js/vendor/select2.min.js"></script>

<script type="text/javascript" src="js/vendor/jquery.dataTables.js"></script>

<script type="text/javascript" src="js/vendor/DT_bootstrap.js"></script>
<script type="text/javascript" src="js/vendor/fnReloadAjax.js"></script>
<script type="text/javascript" src="js/vendor/jquery.multi-select.js"></script>
<!-- END PAGE LEVEL PLUGINS -->

<!-- BEGIN PAGE LEVEL SCRIPTS -->

<script src="js/vendor/app.js"></script>
<script src="js/common/common.js"></script>

<script src="diser/js/diser.js"></script>

<script>

    $("#queryCommBtn").on("click", function () {
        $("#addComm").modal('show');
        var disId = sessionStorage.getItem("disId");
        $.ajax({
            type: "POST",
            url: "communityAction!getCommunityForDiser.action",
            data: {"disId": disId},
            dataType: "json",
            success: function (data) {
                $("#my_multi_select1").empty();
                for (var i = 0; i < data.list.length; i++) {


                    var  _html = '<option value='+ data.list[i].commId +'>' + data.list[i].commName + '</option>';
                    jQuery("#my_multi_select1").append(_html);
                }



                $('#my_multi_select1').multiSelect();









            }
        });
    });

    $("#js_rel_commbtn").on("click", function () {

        var disId = sessionStorage.getItem("disId");
        var str = "";



        $("#my_multi_select1").find("option:selected").each(function () {
            str += $(this).val() + ",";
        });

        $.ajax({
            type: "POST",
            url: "diserAction!relComm.action",
            data: {"disId": disId, "str": str},
            dataType: "json",
            success: function (data) {
                if (data.resultCode == 1) {
                    $("#addComm").modal('hide');
                    $(".ms-list").empty();
                    createAlertMsgMainWin("关联成功");


                    DiserCommTableManaged._table.fnReloadAjax();
                } else {
                    $(".ms-list").empty();
                    createAlertMsgMainWin("关联失败");

                }
            }
        });
    });

    $("#js_rel_cancelbtn").on("click",function(){

        $("#addComm").modal("hide");
    })

    function delCommRel(commId) {
        var disId = sessionStorage.getItem("disId");
        showloading();
        $.post("diserAction!delCommRel.action", {"commId": commId, "disId": disId}, function (data) {
            var resultCode = data.resultCode;
            if (resultCode == 1) {
                closeloading();
                $('#msgMain_sign').modal('hide');
                createAlertMsgMainWin("删除成功");
                DiserCommTableManaged._table.fnReloadAjax();
            }
            else {
                createAlertMsgMainWin("删除失败");
            }

        }, "json");
    }


    jQuery(document).ready(function () {
        //sessionStorage.setItem("disId", disId);
        var disId = sessionStorage.getItem("disId");
        App.init();

        DiserCommTableManaged.init(disId);

        $.ajax({
            type: "POST",
            url: "diserAction!queryDiserById.action",
            data: {"disId": disId},
            dataType: "json",
            success: function (data) {
                if (data.resultCode == 1) {
                    $(".caption").html('<i class="icon-globe"></i>' + data.disName + '  的收件小区');
                }
            }
        });

        $("#allBtn").on("click", function () {

            TableManaged.init();
        });
        $("#todayBtn").on("click", function () {

            TableManaged.init(1);
        });
        $("#weakBtn").on("click", function () {

            TableManaged.init(2);
        });
        $("#monthBtn").on("click", function () {

            TableManaged.init(3);
        });
        $("#freshBtn").on("click", function () {

            TableManaged._table.fnReloadAjax();
        });



    });

</script>
</body>
</html>